package com.home.admin.monitor;

import com.home.common.annotation.CheckApiClient;
import com.home.common.constants.client.ClientConstant;
import com.home.webapp.monitor.service.ServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description: 服务器监控
 * Created by 王大宸 on 2020-10-11 17:55
 * Created with IntelliJ IDEA.
 */
@Controller
@RequestMapping(value = "/monitor/server")
@CheckApiClient(title = "服务器监控", clientId = ClientConstant.CLIENT_WEB)
public class ServerController {
    private static final String PATH_PREFIX = "monitor/server" ;
    @Autowired
    private ServerService serverService;

    /***
     * 功能说明：跳转到服务监控页面
     *
     * @author 王大宸
     * @date 2020/10/11 17:56
     * @param
     * @return java.lang.String
     */
    @GetMapping(value = "/index")
    public String index(ModelMap modelMap) {
        modelMap.put("server", serverService.getServerInfo());
        return PATH_PREFIX + "/index" ;
    }

}
